/*
 * Copyright (c) 2022 Kirky
 * Licensed under the Open Software Licence, Version 3.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://opensource.org/licenses/osl-3.0.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.lingeringdream.luciole;

import com.lingeringdream.luciole.model.entity.Classification;
import com.lingeringdream.luciole.model.helper.ValuesBucketHelper;
import com.lingeringdream.luciole.slice.InitializationSlice;
import com.lingeringdream.luciole.slice.LocalResourceWebViewSlice;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.ability.DataAbilityHelper;
import ohos.aafwk.content.Intent;
import ohos.agp.window.service.WindowManager;
import ohos.data.dataability.DataAbilityPredicates;
import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;

/**
 * 初始化页面Ability
 *
 * @author Kirky
 * @version 1.0
 * @date 2022/4/28
 */
public class InitializationAbility extends Ability {
    private static final HiLogLabel TAG = new HiLogLabel(HiLog.LOG_APP, 0x0, InitializationAbility.class.getName());

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setMainRoute(InitializationSlice.class.getName());
        addActionRoute("action.relu", LocalResourceWebViewSlice.class.getName());
    }


    private void setSystemBar() {
//        getWindow().addFlags(WindowManager.LayoutConfig.MARK_TRANSLUCENT_NAVIGATION);
//        getWindow().setStatusBarColor(Color.RED.getValue());
        getWindow().setSystemBarStyle(
                WindowManager.LayoutConfig.SYSTEM_BAR_BRIGHT_NAVIGATION |
                        WindowManager.LayoutConfig.SYSTEM_BAR_BRIGHT_STATUS);
    }

    private void initDb() {
        DataAbilityHelper helper = DataAbilityHelper.create(this);
/*
        Classification classification = new Classification();
        classification.set
        helper.insert("dataability://com.lingeringdream.luciole.db.classData",
                ValuesBucketHelper.class2Bucket())*/
    }
}
